<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateOpenShopSignOrderPayHistory extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('open_shop_sign_order_pay_history', function (Blueprint $table) {
            $table->id();

            $table->string('orderNo', 60)->default('')->comment('订单号');
            $table->string('payNo', 60)->default('')->comment('支付订单号');

            $table->unsignedInteger('shouldPayPrice')->default(0)->comment('应付金额');
            $table->unsignedInteger('payPrice')->default(0)->comment('实付金额');
            $table->unsignedTinyInteger('payStatus')->default(0)->comment('支付状态 0 - 待支付 1-已支付');
            $table->unsignedTinyInteger('payChannel')->default(0)->comment('支付方式');
            $table->unsignedInteger('payTime')->default(0)->comment('支付时间');
            $table->unsignedTinyInteger('type')->default(0)->comment('流水类型 1 - 定金 2 - 尾款');

            $table->unsignedInteger('isDeleted')->default(0)->comment('是否删除 0 - 正常 1 - 已删除');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');

            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '招商加盟 - 签约订单支付流水';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('open_shop_order_sign_pay_history');
    }
}
